home *** CD-ROM | disk | FTP | other *** search
/ Aminet 15 / Aminet 15 - Nov 1996.iso / Aminet / comm / mail / YamNet.lha / Base64Coders.lha / Base64Coders / Rexx / Spot / Base64Decode.spot
Text File  |  1996-03-11  |  1KB  |  52 lines

  1. /*
  2.    $VER: Base64Decode.spot 1.1 (7.3.96)
  3.    Written by Edmund Vermeulen (edmundv@grafix.xs4all.nl).
  4.  
  5.    ARexx script for Spot to use Base64Decode 1.1 to decode a base64 encoded
  6.    file from the current message.
  7. */
  8.  
  9. outpath='RAM:'  /* default output path for decoding */
  10.  
  11.  
  12. options results
  13. options failat 21
  14. cr='0d'x
  15.  
  16. ismessages
  17. if rc=5 then do
  18.    requestnotify 'PROMPT "Base64Decode.spot can only be used'cr'from the message window!"'
  19.    exit
  20.    end
  21.  
  22. requestpath 'TITLE "Select decode destination" PATH "'outpath'"'
  23. if rc>0 then
  24.    exit
  25. outpath=result
  26. saveascii 'TO "T:base64.temp" OVERWRITE NOHEADER NOTEARLINE NOORIGIN NOKLUDGES NOREFLOW'
  27.  
  28. address command 'Base64Decode >T:base64.output T:base64.temp "'outpath'" USEMINLEN'
  29. if rc=10 then do
  30.    requestfile 'TITLE "Select output filename" PATH "'outpath'"'
  31.    if rc>0 then
  32.       signal quitit
  33.    outfilename=result
  34.    address command 'Base64Decode >T:base64.output T:base64.temp "'outfilename'" USEMINLEN'
  35.    end
  36. if rc>0 then
  37.    beep
  38.  
  39. call open('output','T:base64.output','r')
  40. line=readln('output')
  41. call close('output')
  42. parse var line written ' "' filename '"'
  43. requestnotify 'PROMPT "'written||cr||filename'"'
  44.  
  45.  
  46. quitit:
  47.  
  48.    if ~show('l','rexxsupport.library') then
  49.       call addlib('rexxsupport.library',0,-30)  /* needed for delete() */
  50.    call delete('T:base64.temp')
  51.    call delete('T:base64.output')
  52.